package testplan.entities;

import java.util.Date;
import java.util.Set;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;



@PersistenceCapable
public class TestCase {

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long key;
	@Persistent
	private String title;
	@Persistent
	private String description;
	@Persistent
	private String steps;
	@Persistent
	private String expectedResults;
	// foreign key to User
	@Persistent
	private Long createdBy;
	// foreign key to User
	@Persistent
	private Long updatedBy;
	@Persistent
	private Date createdAt;
	@Persistent
	private Date updatedAt;
	// foreign key to Tag
	@Persistent
	private Set<Long> tags;
	// foreign key to Project
	@Persistent
	private Long plan;

	public TestCase(String title, String description, String steps, String expectedResults, long createdBy, Date createdAt, long planId)
    {
		super();
		this.title = title;
		this.description = description;
		this.steps = steps;
		this.expectedResults = expectedResults;
		this.createdBy = createdBy;
		this.createdAt = createdAt;
		this.plan = planId;
	}

    public TestCase(String title, String description, String steps, String expectedResults, long createdBy, long planId)
    {
        this(title, description, steps, expectedResults, createdBy, new Date(), planId);
    }
	
	public long getPlan() {
		return plan;
	}

	public void setPlan(long planId) {
		this.plan = planId;
	}


	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getSteps() {
		return steps;
	}

	public void setSteps(String steps) {
		this.steps = steps;
	}

	public String getExpectedResults() {
		return expectedResults;
	}

	public void setExpectedResults(String expectedResults) {
		this.expectedResults = expectedResults;
	}

	public Long getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(Long createdBy) {
		this.createdBy = createdBy;
	}

	public Long getUpdatedBy() {
		return updatedBy;
	}

	public void setUpdatedBy(Long updatedBy) {
		this.updatedBy = updatedBy;
	}

	public Date getCreatedAt() {
		return createdAt;
	}

	public void setCreatedAt(Date createdAt) {
		this.createdAt = createdAt;
	}

	public Date getUpdatedAt() {
		return updatedAt;
	}

	public void setUpdatedAt(Date updatedAt) {
		this.updatedAt = updatedAt;
	}

	public long getKey()
    {
		return key;
	}

    public void setKey(long key)
    {
        this.key = key;
    }

	public Set<Long> getTags() {
		return tags;
	}

	public void setTags(Set<Long> tags) {
		this.tags = tags;
	}
	
	

}
